package com.cn.wanxi.consumer;

import com.cn.wanxi.consumer.domain.model.ResultModel;
import com.cn.wanxi.consumer.service.IUserService;
import com.cn.wanxi.consumer.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class ConsumerApplication {


    public static void main(String[] args) {
        ConfigurableApplicationContext application = SpringApplication.run(ConsumerApplication.class, args);

        IUserService userService = application.getBean(UserServiceImpl.class);
        ResultModel resultModel = userService.loadUsers2Redis();
        System.out.println("加载到redis缓存的用户数量为：" + resultModel.getCount() + " 位");

    }

}
